BXMailBlockEditorHandler=function(){this.init=function(){this.helper=new BXBlockEditorHelper;this.handlerList={};this.initHandlerVars();this.initHandlerList();this.bind()};this.bind=function(){if(!BX.BlockEditorManager){return}BX.addCustomEvent(BX.BlockEditorManager,"onEditorAdd",BX.delegate(function(t){BX.addCustomEvent(t,"onBlockInitHandlers",BX.delegate(function(t,e){if(!this.handlerList[e]){return}t.editHandlerList=this.handlerList[e];this.helper.each(this.handlersByType[e]["prop"],function(e,n){t[n]=e},this)},this))},this))};this.initHandlerList=function(){this.handlerList={};this.helper.each(this.handlersByType,function(t,e){this.helper.each(this.handlersByType[e].preset.list,function(t){this.helper.each(this.presetHandlers[t],function(n,i){var r=BX.clone(n);r["className"]=t;if(!this.handlerList[e]){this.handlerList[e]={}}this.handlerList[e][i]=r},this)},this);this.helper.each(t.preset.exclude,function(t){if(this.handlerList[e][t]){this.handlerList[e][t]=null;delete this.handlerList[e][t]}},this);this.helper.each(t.list,function(t,n){if(!this.handlerList[e]){this.handlerList[e]={}}this.handlerList[e][n]=t},this)},this)};this.initHandlerVars=function(){this.presetHandlers={bxBlockContentText:{content:{func:function(t,e,n){return this.helper.innerHTML(t,n)},reload_dependence:["column-count"]}},bxBlockContentEdge:{"background-color":{func:function(t,e,n){return this.helper.color(t,e,n)}},border:{func:function(t,e,n){return this.helper.style(t,e,n)}}},bxBlockContentLine:{"background-color":{func:function(t,e,n){return this.helper.color(t,e,n)}},height:{func:function(t,e,n){return this.helper.style(t,e,n)}},"margin-top":{func:function(t,e,n){return this.helper.style(t,e,n)}},"margin-bottom":{func:function(t,e,n){return this.helper.style(t,e,n)}}},bxBlockContentImageGroup:{src:{func:function(t,e,n){return this.helper.groupImageSrc(t,n)},params:{multi:true}}},bxBlockContentImage:{align:{func:function(t,e,n){this.helper.style(t,"text-align",n);return this.helper.attr(BX.findChild(t,{tag:"img"},true),e,n)}},src:{func:function(t,e,n){return this.helper.imageSrc(BX.findChild(t,{tag:"img"},true),n)},params:{multi:false}},title:{func:function(t,e,n){return this.helper.attr(BX.findChild(t,{tag:"img"},true),e,n)}},href:{func:function(t,e,n){return this.helper.attr(BX.findChild(t,{tag:"a"},true),e,n)}}},bxBlockContentButton:{button_caption:{func:function(t,e,n){return this.helper.textContent(t,n)}},color:{func:function(t,e,n){return this.helper.color(t,e,n)}},"font-size":{func:function(t,e,n){return this.helper.style(t,e,n)}},padding:{func:function(t,e,n){return this.helper.style(t,e,n)}},href:{func:function(t,e,n){return this.helper.attr(t,e,n)}},"text-decoration":{func:function(t,e,n){return this.helper.style(t,e,n)}}},bxBlockContentButtonEdge:{"background-color":{func:function(t,e,n){return this.helper.color(t,e,n)}},wide:{func:function(t,e,n){if(typeof n!=="undefined"){if(n==="N"){t.removeAttribute("width")}else{t.setAttribute("width","100%")}}if(t.getAttribute("width")){return"Y"}else{return"N"}}},border:{func:function(t,e,n){return this.helper.style(t,e,n)}},"border-radius":{func:function(t,e,n){return this.helper.style(t,e,n)}},align:{func:function(t,e,n){return this.helper.attr(t,e,n)}},width:{func:function(t,e,n){return this.helper.attr(BX.findChild(t,{tag:"td"},true),e,n)}}},bxBlockImageText:{imagetextpart:{func:function(t,e,n){return this.helper.imageTextPart(t,n)}},imagetextalign:{func:function(t,e,n){return this.helper.imageTextAlign(t,n)}}},bxBlockContentSocial:{"font-size":{func:function(t,e,n){return this.helper.style(t,e,n)}},color:{func:function(t,e,n){return this.helper.color(t,e,n)}},"text-decoration":{func:function(t,e,n){return this.helper.style(t,e,n)}}},bxBlockContentEdgeSocial:{social_content:{func:function(t,e,n){var i;if(typeof n!=="undefined"){n=JSON.parse(n);var r=BX.findChildren(t,{tag:"table"},true);var l=n.length-r.length;var o=Math.abs(l);var c=l<0;if(l!==0){for(var s=0;s<o;s++){if(c){BX.remove(r.pop())}else{r[0].parentNode.appendChild(BX.clone(r[0]))}}}r=BX.findChildren(t,{tag:"table"},true);for(var u=0;u<n.length;u++){var h=n[u];var a=BX.findChild(r[u],{tag:"a"},true);a.textContent=h.name.trim();a.href=BX.util.htmlspecialchars(h.href.trim());a.title=BX.util.htmlspecialchars(h.name.trim())}}i=BX.findChildren(t,{tag:"a"},true);var d=[];this.helper.each(i,function(t){d.push({href:t.href,name:t.text.trim()})});return JSON.stringify(d)}},align:{func:function(t,e,n){return this.helper.attr(t,e,n)}}}};this.handlersByType={code:{preset:{list:[],exclude:[]},list:{"html-raw":{className:"",func:function(t,e,n){return this.helper.innerHTML(t,n)}}}},line:{preset:{list:["bxBlockContentLine"],exclude:[]},list:{}},text:{preset:{list:["bxBlockContentText"],exclude:[]},list:{"column-count":{className:"bxBlockContentText",func:function(t,e,n){return this.helper.column(t,e,n)}},paddings:{className:"bxBlockContentText",func:function(t,e,n){return this.helper.paddings(t,e,n)}}}},boxedtext:{preset:{list:["bxBlockContentText","bxBlockContentEdge"],exclude:[]},list:{"column-count":{className:"bxBlockContentText",func:function(t,e,n){return this.helper.column(t,e,n)}},paddings:{className:"bxBlockContentEdge",func:function(t,e,n){return this.helper.paddings(t.parentNode,e,n)}}}},image:{preset:{list:["bxBlockContentImage"],exclude:[]},list:{paddings:{className:"bxBlockContentImage",func:function(t,e,n){return this.helper.paddings(t,e,n)}}},prop:{onMove:function(t,e){}}},imagegroup:{preset:{list:["bxBlockContentImageGroup"],exclude:["href"]},list:{paddings:{className:"bxBlockContentImage",func:function(t,e,n){return this.helper.paddings(t,e,n)}}}},imagetext:{preset:{list:["bxBlockImageText","bxBlockContentImage","bxBlockContentText"],exclude:["align"]},list:{}},boxedimage:{preset:{list:["bxBlockContentEdge","bxBlockContentImage","bxBlockContentText"],exclude:[]},list:{},prop:{onMove:function(t,e){}}},button:{preset:{list:["bxBlockContentButtonEdge","bxBlockContentButton"],exclude:[]},list:{}},social:{preset:{list:["bxBlockContentSocial","bxBlockContentEdgeSocial"],exclude:[]},list:{}}}};var t=this;BX.ready(function(){t.init()})};new BXMailBlockEditorHandler;
//# sourceMappingURL=mail_handlers.map.js